Filters the source collection based on a predicate.

Namespace:  C1.LiveLinq
Assembly:  C1.LiveLinq (in C1.LiveLinq.dll)

Syntax

C#
public static IIndexedSource<T> Where<T>(
	this IIndexedSource<T> source,
	Expression<Func<T, bool>> predicate
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function Where(Of T) ( _
	source As IIndexedSource(Of T), _
	predicate As Expression(Of Func(Of T, Boolean)) _
) As IIndexedSource(Of T)

Parameters

source
Type: C1.LiveLinq.Indexing..::..IIndexedSource<(Of <(<'T>)>)>
An IIndexedSource<(Of <(<'T>)>)> to filter.
predicate
Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'T, Boolean>)>)>>)>)>
A function to test each element for a condition.

Type Parameters

T
The type of the elements of source.

Return Value

An IIndexedSource<(Of <(<'T>)>)> that contains elements from the input collection that satisfy the condition.

Remarks

If an index is used to optimized performance of this operation, the resulting collection may not be in the same order as the source collection. If you need to preserve the order, use the other overload of the Where operator. It will still be optimized, albeit to a lesser degree.

See Also